<include file="public@header"/>
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="{:url('Notification/index')}">通知列表</a></li>
        <li><a href="{:url('Notification/add')}">通知增加</a></li>
    </ul>
    <form class="well form-inline margin-top-20 bg-white" method="get" action="{:url('Notification/index')}">
        标题:
        <input type="text" class="form-control" name="keyword" style="width: 200px;"
               value="{$keyword|default=''}" placeholder="请输入关键字">
        <button class="btn btn-primary">搜索</button>
    </form>
    <form class="js-ajax-form" method="post">
        <table class="table table-hover table-bordered table-list">
            <thead>
            <tr>
                <th>序号</th>
                <th>标题</th>
                <th>概要</th>
                <th>排序</th>
                <th>通知类型</th>
                <th>修改时间</th>
                <th>操作</th>
            </tr>
            </thead>
            <foreach name="pages" item="vo">
                <tr>
                    <td>
                        {$vo.id}
                    </td>
                    <td>{$vo.title}</td>
                    <td>{$vo.summary}</td>
                    <td>{$vo.sort_order}</td>
                    <td>{$vo.notification_type == 0 ? "通知公告" : "预警公告"}</td>
                    <td>
                        {:date('Y-m-d H:i',$vo['update_time'])}
                    </td>
                    <td>
                        <a class="btn btn-xs btn-primary" href="javascript:;"
                           onclick="openPortalPageEditDialog(this)"
                           data-href="{:url('Notification/edit',array('id'=>$vo['id']))}">{:lang('EDIT')}</a>
                        <a class="btn btn-xs btn-danger js-ajax-delete"
                           href="{:url('Notification/delete',array('id'=>$vo['id']))}">{:lang('DELETE')}</a>
                    </td>
                </tr>
            </foreach>
        </table>
        <div class="pagination">{$page}</div>
    </form>
</div>
<script src="__STATIC__/js/admin.js?v={$_static_version}"></script>

<script>
    function openPortalPageEditDialog(obj) {
        var $obj = $(obj);
        var href = $obj.data('href');
        parent.openIframeLayer(href, '编辑页面', {
            area: GV.IS_MOBILE ? ['100%', '100%'] : ['95%', '95%'],
            offset: GV.IS_MOBILE ? ['0px', '0px'] : 'auto',
            // btn: ['确定', '取消'],
            yes: function (index, layero) {
                console.log(layero);
                var iframeWin = parent.window[layero.find('iframe')[0]['name']];
                //iframeWin.confirm();
                parent.layer.close(index); //如果设定了yes回调，需进行手工关闭
            },
            end: function () {
            }
        });
    }
</script>
</body>
</html>
